package demo2;

public class 懒汉单线程 {
    private static 懒汉单线程 instance = null;
    private 懒汉单线程() {

    }
    public synchronized static 懒汉单线程 getInstance() {
        if (instance == null) {
            instance = new 懒汉单线程();
        }
        return instance;
    }
}
